package com.flysky.service.user.impl;

import java.util.Date;
import java.util.HashMap;

import com.flysky.dao.user.IUserDao;
import com.flysky.model.user.UserHbmModel;
import com.flysky.service.user.IUserService;

public class UserActionService implements IUserService {
	
	IUserDao userDao = null;
	
	
	public void setUserDao(IUserDao userDao) {
		this.userDao = userDao;
	}


	@Override
	public UserHbmModel insertNewUser(UserHbmModel newUser) {
		return this.userDao.insertUser(newUser);
	}


	@Override
	public UserHbmModel userLogin(HashMap<String, String> param) {
		UserHbmModel userModel = this.userDao.findUser(param);
		if(null != userModel){
			userModel.setLastLoginDate(new Date());
			userModel = this.userDao.saveOrUpdateUser(userModel);
		}
		return userModel;
	}


	@Override
	public boolean checkUserExisted(String userName) {
		// TODO Auto-generated method stub
		return false;
	}

}
